<template>
  <form-create
      v-model="fapi"
      :rule="rule"
      :option="option"
      @submit="onSubmit"
  ></form-create>
</template>

<script>
import formCreate from "@form-create/element-ui";
export default {
  name: "formCreate",
  data() {
    return {
      fapi: null,
      rule: formCreate.parseJson('[{"type":"input","field":"Fdu85y8ngd1ta","title":"输入框","info":"","props":{"maxlength":1,"showWordLimit":true},"_fc_drag_tag":"input","hidden":false,"display":true,"$required":""},{"type":"switch","field":"Fkvz5y8ngxst1","title":"开关","info":"","_fc_drag_tag":"switch","hidden":false,"display":true},{"type":"switch","field":"Fxkn5y9qq11un","title":"开关","info":"","_fc_drag_tag":"switch","hidden":false,"display":true}]'),
      option: formCreate.parseJson('{"form":{"labelPosition":"right","size":"mini","labelWidth":"125px","hideRequiredAsterisk":false,"showMessage":true,"inlineMessage":false},"submitBtn":false,"resetBtn":false}')

    }
  },
  methods:{
    onSubmit (formData) {
      //todo 提交表单
    }
  }
}
</script>

<style scoped>

</style>